//
// Created by wze-zero on 2024/9/16 016.
//
#include <iostream>
#include <vector>

using namespace std;

int main() {
    int count, num;
    vector<int> vec;
    bool check = false;
    cin >> count;
    for (int i = 0; i < count; ++i) {
        cin >> num;
        vec.push_back(num);
    }
    for (vector<int>::iterator it = vec.begin(); it != vec.end() - 1; ++it) {
        if (*it < *(it + 1)) {
            break;
        } else if (it == vec.end() - 2) {
            check = true;
        }
    }
    for (vector<int>::iterator it = vec.begin(); it != vec.end() - 1; ++it) {
        if (*it > *(it + 1)) {
            break;
        } else if (it == vec.end() - 2) {
            check = true;
        }
    }
    check ? cout << "sorted" << endl : cout << "unsorted" << endl;
    return 0;
}